{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<a target=\"_blank\" href=\"https://colab.research.google.com/github/cohere-ai/notebooks/blob/main/notebooks/What_is_Semantic_Search.ipynb\">\n",
    "  <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
    "</a>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "QrZoppfP32yt"
   },
   "source": [
    "# What is Semantic Search?\n",
    "\n",
    "In this notebook, you'll build a semantic search model on a small dataset using Cohere's Embed endpoint.\n",
    "\n",
    "_Read the accompanying blog post [here](https://docs.cohere.com/docs/what-is-semantic-search)._"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Setup\n",
    "\n",
    "We'll start by installing the tools we'll need and then importing them."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/"
    },
    "id": "KfHExgpe3-WU",
    "outputId": "793e8110-91c5-4d9b-9fc5-9a04f889df91"
   },
   "outputs": [],
   "source": [
    "# Install Cohere for embeddings, Umap to reduce embeddings to 2 dimensions, \n",
    "# Altair for visualization, Annoy for approximate nearest neighbor search\n",
    "!pip install cohere umap-learn altair annoy datasets tqdm -q"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "id": "jrtPurK92qD6"
   },
   "outputs": [],
   "source": [
    "import cohere\n",
    "import numpy as np\n",
    "import re\n",
    "import pandas as pd\n",
    "from tqdm import tqdm\n",
    "from datasets import load_dataset\n",
    "import umap\n",
    "import altair as alt\n",
    "from sklearn.metrics.pairwise import cosine_similarity\n",
    "from annoy import AnnoyIndex\n",
    "import warnings\n",
    "warnings.filterwarnings('ignore')\n",
    "pd.set_option('display.max_colwidth', None)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Fill in your Cohere API key in the next cell. To do this, begin by [signing up to Cohere](https://os.cohere.ai/) (for free!) if you haven't yet. Then get your API key [here](https://dashboard.cohere.com/api-keys)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "id": "agXt3qRK5N8o"
   },
   "outputs": [],
   "source": [
    "# Paste your API key here. Remember to not share publicly\n",
    "co = cohere.Client(\"COHERE_API_KEY\") "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "xfwpfElZ0rjJ"
   },
   "source": [
    "## The dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 300
    },
    "id": "P6uurRiy3-Gu",
    "outputId": "3efeb1b2-c663-4fd3-edb8-666fa7597465"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Where is the world cup?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>The world cup is in Qatar</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>What color is the sky?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>The sky is blue</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Where does the bear live?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>The bear lives in the the woods</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>What is an apple?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>An apple is a fruit</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                              text\n",
       "0          Where is the world cup?\n",
       "1        The world cup is in Qatar\n",
       "2           What color is the sky?\n",
       "3                  The sky is blue\n",
       "4        Where does the bear live?\n",
       "5  The bear lives in the the woods\n",
       "6                What is an apple?\n",
       "7              An apple is a fruit"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qa_df = pd.DataFrame({'text':\n",
    "  [\n",
    "   'Where is the world cup?',\n",
    "   'The world cup is in Qatar',\n",
    "   'What color is the sky?',\n",
    "   'The sky is blue',\n",
    "   'Where does the bear live?',\n",
    "   'The bear lives in the the woods',\n",
    "   'What is an apple?',\n",
    "   'An apple is a fruit',\n",
    "  ]})\n",
    "\n",
    "qa_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "VWUOlOD80tUN"
   },
   "source": [
    "## Creating the embedding"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "id": "gKcbOZ7y4Wc9"
   },
   "outputs": [],
   "source": [
    "qa = co.embed(texts=list(qa_df['text']), model='embed-english-v3.0', input_type=\"search_document\").embeddings"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "YAPQbyo_0vEu"
   },
   "source": [
    "## Plotting the embedding in 2D"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 468
    },
    "id": "U9eRFb5X50wA",
    "outputId": "32358ca2-e1fd-4c04-ef5d-91cecc43e195"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<style>\n",
       "  #altair-viz-7343611b789e45e09c3550159e795364.vega-embed {\n",
       "    width: 100%;\n",
       "    display: flex;\n",
       "  }\n",
       "\n",
       "  #altair-viz-7343611b789e45e09c3550159e795364.vega-embed details,\n",
       "  #altair-viz-7343611b789e45e09c3550159e795364.vega-embed details summary {\n",
       "    position: relative;\n",
       "  }\n",
       "</style>\n",
       "<div id=\"altair-viz-7343611b789e45e09c3550159e795364\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n",
       "  (function(spec, embedOpt){\n",
       "    let outputDiv = document.currentScript.previousElementSibling;\n",
       "    if (outputDiv.id !== \"altair-viz-7343611b789e45e09c3550159e795364\") {\n",
       "      outputDiv = document.getElementById(\"altair-viz-7343611b789e45e09c3550159e795364\");\n",
       "    }\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm/vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm/vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm/vega-lite@5.16.3?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm/vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function maybeLoadScript(lib, version) {\n",
       "      var key = `${lib.replace(\"-\", \"\")}_version`;\n",
       "      return (VEGA_DEBUG[key] == version) ?\n",
       "        Promise.resolve(paths[lib]) :\n",
       "        new Promise(function(resolve, reject) {\n",
       "          var s = document.createElement('script');\n",
       "          document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "          s.async = true;\n",
       "          s.onload = () => {\n",
       "            VEGA_DEBUG[key] = version;\n",
       "            return resolve(paths[lib]);\n",
       "          };\n",
       "          s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "          s.src = paths[lib];\n",
       "        });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else {\n",
       "      maybeLoadScript(\"vega\", \"5\")\n",
       "        .then(() => maybeLoadScript(\"vega-lite\", \"5.16.3\"))\n",
       "        .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 300, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-f119c070bfa68ebaa49be118cb553935\"}, \"mark\": {\"type\": \"circle\", \"size\": 60}, \"encoding\": {\"tooltip\": [{\"field\": \"text\", \"type\": \"nominal\"}], \"x\": {\"field\": \"x\", \"scale\": {\"zero\": false}, \"type\": \"quantitative\"}, \"y\": {\"field\": \"y\", \"scale\": {\"zero\": false}, \"type\": \"quantitative\"}}, \"height\": 400, \"params\": [{\"name\": \"param_1\", \"select\": {\"type\": \"interval\", \"encodings\": [\"x\", \"y\"]}, \"bind\": \"scales\"}], \"width\": 700, \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.16.3.json\", \"datasets\": {\"data-f119c070bfa68ebaa49be118cb553935\": [{\"text\": \"Where is the world cup?\", \"x\": 0.10916253179311752, \"y\": 6.968442440032959}, {\"text\": \"The world cup is in Qatar\", \"x\": 0.3937394917011261, \"y\": 6.683285713195801}, {\"text\": \"What color is the sky?\", \"x\": -11.251619338989258, \"y\": -4.348402500152588}, {\"text\": \"The sky is blue\", \"x\": -11.563275337219238, \"y\": -4.660341262817383}, {\"text\": \"Where does the bear live?\", \"x\": -19.38410186767578, \"y\": -3.845724105834961}, {\"text\": \"The bear lives in the the woods\", \"x\": -19.695642471313477, \"y\": -4.1576619148254395}, {\"text\": \"What is an apple?\", \"x\": 8.69540023803711, \"y\": 7.115650177001953}, {\"text\": \"An apple is a fruit\", \"x\": 8.387487411499023, \"y\": 7.424482822418213}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# UMAP reduces the dimensions from 1024 to 2 dimensions that we can plot\n",
    "reducer = umap.UMAP(n_neighbors=2) \n",
    "umap_embeds = reducer.fit_transform(qa)\n",
    "# Prepare the data to plot and interactive visualization\n",
    "# using Altair\n",
    "#df_explore = pd.DataFrame(data={'text': qa['text']})\n",
    "#print(df_explore)\n",
    "\n",
    "#df_explore = pd.DataFrame(data={'text': qa_df[0]})\n",
    "df_explore = qa_df\n",
    "df_explore['x'] = umap_embeds[:,0]\n",
    "df_explore['y'] = umap_embeds[:,1]\n",
    "\n",
    "# Plot\n",
    "chart = alt.Chart(df_explore).mark_circle(size=60).encode(\n",
    "    x=#'x',\n",
    "    alt.X('x',\n",
    "        scale=alt.Scale(zero=False)\n",
    "    ),\n",
    "    y=\n",
    "    alt.Y('y',\n",
    "        scale=alt.Scale(zero=False)\n",
    "    ),\n",
    "    tooltip=['text']\n",
    ").properties(\n",
    "    width=700,\n",
    "    height=400\n",
    ")\n",
    "chart.interactive()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "6Sr9U66jzwf_"
   },
   "source": [
    "## Plotting the cosine similarities"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 269
    },
    "id": "a6ScQzHA49Ds",
    "outputId": "c0310077-0b62-4042-d8f8-fb80a9d21d99"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGiCAYAAAB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8nhbdAAAAdjMMw7bREbR4AWFYWJjGjRunLVu26OjRo3rooYe0Zs0aDRgwwM74AAC46AIybBsdgS1PE/Tr109PPvmkjh07pi1btthxSgAAcJFY2mcgPj5eISEh5/zc4/Hotttua3VQAAA4qaOU9+1iKRk4duxYW8UBAEC70VEeCbQLOxACAGDitsoAOxACAOByVAYAADDpKE8B2IVkAAAAE9oEAADAVagMAABgwtMEAAC4XEd5wZBdaBMAAOByVAYAADChTQAAgMvxNAEAAHAVKgMAAJi4bQEhyQAAACZuaxOQDAAAYOK2ZIA1AwAAuByVAQAATNxVF5BkuMRXX31lzJkzx/jqq6+cDqXFOsM9GEbnuI/OcA+GwX20J53hHgyj89yH23gMwx2NkdraWkVFRammpkaRkZFOh9MineEepM5xH53hHiTuoz3pDPcgdZ77cBvWDAAA4HIkAwAAuBzJAAAALueaZMDr9WrOnDnyer1Oh9JineEepM5xH53hHiTuoz3pDPcgdZ77cBvXLCAEAABNc01lAAAANI1kAAAAlyMZAADA5UgGAABwOZIBAABczhXJQGFhoRISEhQREaHk5GTt2LHD6ZAsefvttzVmzBj16dNHHo9Hr776qtMhWebz+TR06FB1795dvXr10tixY3Xw4EGnw7KsqKhIN9xwgyIjIxUZGanU1FRt3rzZ6bBaxefzyePxaMaMGU6HYsmTTz4pj8cTNHr37u10WC1y4sQJ3X///erZs6cuueQS3XjjjSotLXU6rGbr379/o78Lj8ejqVOnOh0amqnTJwPr1q3TjBkzNHv2bJWVlWnEiBHKzMxUeXm506E12+nTpzVkyBC9+OKLTofSYtu3b9fUqVP13nvvqbi4WF9//bUyMjJ0+vRpp0OzpG/fvpo3b552796t3bt3a9SoUbrrrru0b98+p0Nrkffff1+LFy/WDTfc4HQoLTJo0CBVVFQ0jL179zodkmWfffaZ0tPTFRYWps2bN2v//v169tln1aNHD6dDa7b3338/6O+huLhYknT33Xc7HBmazdn3JLW9b3/720ZOTk7Q3MCBA43HH3/coYhaR5KxYcMGp8NotaqqKkOSsX37dqdDabXLLrvMWL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Iw8/Hjh3Tnj17dPnll6tfv34ORtZ8U6dO1csvv6z//u//Vvfu3RuqNVFRUeratavD0TXfE088oczMTMXFxenUqVNau3at3nrrLW3ZssXp0Jqte/fujdZqdOvWTT179uxQazhmzZqlMWPGqF+/fqqqqtLTTz+t2tpaTZw40enQLJk5c6bS0tL0i1/8QuPGjdOuXbu0ePFiLV682OnQLAkEAlq+fLkmTpyo0NBO/6ul83H2YYaLY+HChUZ8fLwRHh5ufOtb3+pwj7Nt27bNkNRoTJw40enQmq2p+CUZy5cvdzo0SyZNmtTw/6UrrrjCGD16tLF161anw2q1jvhoYVZWlhEbG2uEhYUZffr0Mf7jP/7D2Ldvn9Nhtchrr71mJCUlGV6v1xg4cKCxePFip0Oy7PXXXzckGQcPHnQ6FLSAxzAMw5k0BAAAtAedes0AAAC4MJIBAABcjmQAAACXIxkAAMDlSAYAAHA5kgEAAFyOZAAAAJcjGQAAwOVIBgAAcDmSAQAAXI5kAAAAl/v/jFEyYq7u/SIAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import seaborn as sb\n",
    "\n",
    "def plot_similarities(data, embedding):\n",
    "  similarities = []\n",
    "\n",
    "  for i in range(len(data)):\n",
    "    similarities.append([])\n",
    "    for j in range(len(data)):\n",
    "      #print(qa_df['text'][i], ',', qa_df['text'][j], '->', cosine_similarity(np.array([qa[i]]), np.array([qa[j]])))\n",
    "      similarities[-1].append(cosine_similarity(np.array([embedding[i]]), np.array([embedding[j]])))\n",
    "    #print()\n",
    "\n",
    "  similarities = np.array(similarities).squeeze()\n",
    "  #print(similarities)\n",
    "  sb.heatmap(similarities)\n",
    "\n",
    "plot_similarities(qa_df, qa)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "id": "TI2AFuM_EFX9"
   },
   "source": [
    "## A more complicated example"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 457
    },
    "id": "rLL388ui8C5R",
    "outputId": "642374ba-2616-4cf6-d0fc-800817042a29"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Where is the world cup?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>What color is the sky?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Where does the bear live?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>What is an apple?</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>The world cup is in Qatar</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>The world cup is in the moon</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>The previous world cup was in Russia</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>The sky is green</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>The sky is blue</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>The bear lives in the the woods</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>The bear lives in his apartment</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>An apple is a fruit</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Apple is a company</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                    text\n",
       "0                Where is the world cup?\n",
       "1                 What color is the sky?\n",
       "2              Where does the bear live?\n",
       "3                      What is an apple?\n",
       "4              The world cup is in Qatar\n",
       "5           The world cup is in the moon\n",
       "6   The previous world cup was in Russia\n",
       "7                       The sky is green\n",
       "8                        The sky is blue\n",
       "9        The bear lives in the the woods\n",
       "10       The bear lives in his apartment\n",
       "11                   An apple is a fruit\n",
       "12                    Apple is a company"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qa_df_confusing = pd.DataFrame({'text':\n",
    "  [\n",
    "   'Where is the world cup?',\n",
    "   'What color is the sky?',\n",
    "   'Where does the bear live?',\n",
    "   'What is an apple?',\n",
    "   'The world cup is in Qatar',\n",
    "   'The world cup is in the moon',\n",
    "   'The previous world cup was in Russia',\n",
    "   'The sky is green',\n",
    "   'The sky is blue',\n",
    "   'The bear lives in the the woods',\n",
    "   'The bear lives in his apartment',\n",
    "   'An apple is a fruit',\n",
    "   'Apple is a company'\n",
    "  ]})\n",
    "\n",
    "qa_df_confusing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "id": "wuF-go3LEsLB"
   },
   "outputs": [],
   "source": [
    "qa_confusing = co.embed(texts=list(qa_df_confusing['text']), model='embed-english-v3.0', input_type=\"search_document\").embeddings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 468
    },
    "id": "RY4OnBhHELoV",
    "outputId": "be79b56f-79ea-46a6-afa1-e30016294be5"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<style>\n",
       "  #altair-viz-ba1228ba79d04a62857a1ca02b142b4b.vega-embed {\n",
       "    width: 100%;\n",
       "    display: flex;\n",
       "  }\n",
       "\n",
       "  #altair-viz-ba1228ba79d04a62857a1ca02b142b4b.vega-embed details,\n",
       "  #altair-viz-ba1228ba79d04a62857a1ca02b142b4b.vega-embed details summary {\n",
       "    position: relative;\n",
       "  }\n",
       "</style>\n",
       "<div id=\"altair-viz-ba1228ba79d04a62857a1ca02b142b4b\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  var VEGA_DEBUG = (typeof VEGA_DEBUG == \"undefined\") ? {} : VEGA_DEBUG;\n",
       "  (function(spec, embedOpt){\n",
       "    let outputDiv = document.currentScript.previousElementSibling;\n",
       "    if (outputDiv.id !== \"altair-viz-ba1228ba79d04a62857a1ca02b142b4b\") {\n",
       "      outputDiv = document.getElementById(\"altair-viz-ba1228ba79d04a62857a1ca02b142b4b\");\n",
       "    }\n",
       "    const paths = {\n",
       "      \"vega\": \"https://cdn.jsdelivr.net/npm/vega@5?noext\",\n",
       "      \"vega-lib\": \"https://cdn.jsdelivr.net/npm/vega-lib?noext\",\n",
       "      \"vega-lite\": \"https://cdn.jsdelivr.net/npm/vega-lite@5.16.3?noext\",\n",
       "      \"vega-embed\": \"https://cdn.jsdelivr.net/npm/vega-embed@6?noext\",\n",
       "    };\n",
       "\n",
       "    function maybeLoadScript(lib, version) {\n",
       "      var key = `${lib.replace(\"-\", \"\")}_version`;\n",
       "      return (VEGA_DEBUG[key] == version) ?\n",
       "        Promise.resolve(paths[lib]) :\n",
       "        new Promise(function(resolve, reject) {\n",
       "          var s = document.createElement('script');\n",
       "          document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "          s.async = true;\n",
       "          s.onload = () => {\n",
       "            VEGA_DEBUG[key] = version;\n",
       "            return resolve(paths[lib]);\n",
       "          };\n",
       "          s.onerror = () => reject(`Error loading script: ${paths[lib]}`);\n",
       "          s.src = paths[lib];\n",
       "        });\n",
       "    }\n",
       "\n",
       "    function showError(err) {\n",
       "      outputDiv.innerHTML = `<div class=\"error\" style=\"color:red;\">${err}</div>`;\n",
       "      throw err;\n",
       "    }\n",
       "\n",
       "    function displayChart(vegaEmbed) {\n",
       "      vegaEmbed(outputDiv, spec, embedOpt)\n",
       "        .catch(err => showError(`Javascript Error: ${err.message}<br>This usually means there's a typo in your chart specification. See the javascript console for the full traceback.`));\n",
       "    }\n",
       "\n",
       "    if(typeof define === \"function\" && define.amd) {\n",
       "      requirejs.config({paths});\n",
       "      require([\"vega-embed\"], displayChart, err => showError(`Error loading script: ${err.message}`));\n",
       "    } else {\n",
       "      maybeLoadScript(\"vega\", \"5\")\n",
       "        .then(() => maybeLoadScript(\"vega-lite\", \"5.16.3\"))\n",
       "        .then(() => maybeLoadScript(\"vega-embed\", \"6\"))\n",
       "        .catch(showError)\n",
       "        .then(() => displayChart(vegaEmbed));\n",
       "    }\n",
       "  })({\"config\": {\"view\": {\"continuousWidth\": 300, \"continuousHeight\": 300}}, \"data\": {\"name\": \"data-fce2fed37a86786bf5346e278fce173e\"}, \"mark\": {\"type\": \"circle\", \"size\": 60}, \"encoding\": {\"tooltip\": [{\"field\": \"text\", \"type\": \"nominal\"}], \"x\": {\"field\": \"x\", \"scale\": {\"zero\": false}, \"type\": \"quantitative\"}, \"y\": {\"field\": \"y\", \"scale\": {\"zero\": false}, \"type\": \"quantitative\"}}, \"height\": 400, \"params\": [{\"name\": \"param_2\", \"select\": {\"type\": \"interval\", \"encodings\": [\"x\", \"y\"]}, \"bind\": \"scales\"}], \"width\": 700, \"$schema\": \"https://vega.github.io/schema/vega-lite/v5.16.3.json\", \"datasets\": {\"data-fce2fed37a86786bf5346e278fce173e\": [{\"text\": \"Where is the world cup?\", \"x\": 4.214752674102783, \"y\": 8.807564735412598}, {\"text\": \"What color is the sky?\", \"x\": 10.512534141540527, \"y\": -6.417536735534668}, {\"text\": \"Where does the bear live?\", \"x\": 9.741052627563477, \"y\": -11.914958000183105}, {\"text\": \"What is an apple?\", \"x\": -4.330538272857666, \"y\": -0.12386079877614975}, {\"text\": \"The world cup is in Qatar\", \"x\": 3.8861024379730225, \"y\": 8.441215515136719}, {\"text\": \"The world cup is in the moon\", \"x\": 3.567026376724243, \"y\": 8.09428882598877}, {\"text\": \"The previous world cup was in Russia\", \"x\": 4.485987186431885, \"y\": 9.123473167419434}, {\"text\": \"The sky is green\", \"x\": 11.131611824035645, \"y\": -6.771017551422119}, {\"text\": \"The sky is blue\", \"x\": 10.736543655395508, \"y\": -6.6995015144348145}, {\"text\": \"The bear lives in the the woods\", \"x\": 9.384008407592773, \"y\": -12.271141052246094}, {\"text\": \"The bear lives in his apartment\", \"x\": 10.034639358520508, \"y\": -11.620488166809082}, {\"text\": \"An apple is a fruit\", \"x\": -4.647192001342773, \"y\": -0.4346667230129242}, {\"text\": \"Apple is a company\", \"x\": -4.855321407318115, \"y\": -0.6417043805122375}]}}, {\"mode\": \"vega-lite\"});\n",
       "</script>"
      ],
      "text/plain": [
       "alt.Chart(...)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " # UMAP reduces the dimensions from 1024 to 2 dimensions that we can plot\n",
    "reducer = umap.UMAP(n_neighbors=2)\n",
    "umap_embeds = reducer.fit_transform(qa_confusing)\n",
    "# Prepare the data to plot and interactive visualization\n",
    "# using Altair\n",
    "#df_explore = pd.DataFrame(data={'text': qa['text']})\n",
    "#print(df_explore)\n",
    "\n",
    "#df_explore = pd.DataFrame(data={'text': qa_df[0]})\n",
    "df_explore = qa_df_confusing\n",
    "df_explore['x'] = umap_embeds[:,0]\n",
    "df_explore['y'] = umap_embeds[:,1]\n",
    "\n",
    "# Plot\n",
    "chart = alt.Chart(df_explore).mark_circle(size=60).encode(\n",
    "    x=#'x',\n",
    "    alt.X('x',\n",
    "        scale=alt.Scale(zero=False)\n",
    "    ),\n",
    "    y=\n",
    "    alt.Y('y',\n",
    "        scale=alt.Scale(zero=False)\n",
    "    ),\n",
    "    tooltip=['text']\n",
    ").properties(\n",
    "    width=700,\n",
    "    height=400\n",
    ")\n",
    "chart.interactive()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 269
    },
    "id": "31_8qCIU-L3t",
    "outputId": "a74cf627-f975-47b8-b4b0-48aa66737882"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgMAAAGiCAYAAAB6c8WBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAA7UElEQVR4nO3de1xVZd7///cWYUMYWDJySEXMUhLtANUAkR3ppsbJmWnELA+pjYx2IG5PZHOXToU2k+PcGZRjnrImZ7K6rTGTZsx06KCIZWoeRhMzkDyBh9zo3uv3Rz/5tjeILN2bBa3Xcx7X43Gz1ma9r+3dY+8P13WtazkMwzAEAABsq43VHQAAANaiGAAAwOYoBgAAsDmKAQAAbI5iAAAAm6MYAADA5igGAACwOYoBAABsjmIAAACboxgAAMDmKAYAAGghPvzwQ/Xr109xcXFyOBx66623zvg7K1euVHJyskJDQ9WtWze98MILpnMpBgAAaCGOHj2qyy+/XDNnzmzS63fu3Knbb79dGRkZKisr06OPPqqHHnpIixcvNpXr4EFFAAC0PA6HQ2+++ab69+9/2tdMmDBBS5Ys0ebNm+uO5eTk6LPPPtNHH33U5CxGBgAACCCXy6Wamhqv5nK5/HLtjz76SJmZmV7HbrvtNq1du1YnTpxo8nXa+qU3fnBi3w5LciekPGpJriQd0klLcg96/PMf4dlYOCzcktxvl+y3JFeSgsPcluSO2hNmSa4kXeBwWpK74vBWS3IlyeVu+gevP3UMbW9JriSFOKz7Cimr/HdAr+/P76SCmQs0efJkr2OPP/64nnjiiXO+dmVlpaKjo72ORUdH6+TJk9q3b59iY2ObdJ0WUwwAAN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ZowULFkiStm7dqk8//VTXXnutDh48qOnTp+uLL744407AvigGAABoIbKzs7V//35NmTJFFRUVSkpK0tKlSxUfHy9Jqqio8NpzwO1269lnn9WWLVsUHBysG2+8USUlJerataupXIoBAAB8Wbgd8ejRozV69OgGz82bN8/r58TERJWVlZ1zJsUAAAC+WskDhvylxRQDh3TSktw7rmy4+moO/ygrtCQ3OekeS3Il6fygMEty95yotiRXkqJDIizJHVrznSW5khR+JMSS3M/uT7AkV5Lc31xgSW6fd76yJFeS9n932LLsgLPZg4q4mwAAAJtrMSMDAAC0GEwTAABgc0wTAAAAO2FkAAAAXzYbGaAYAADAl2FY3YNmxTQBAAA2x8gAAAC+mCYAAMDmbFYMME0AAIDNMTIAAIAvNh0CAMDmmCZo3HfffafVq1dr06ZN9c4dP35cCxYsOOM1XC6XampqvJrbcJvtCgAAgWEY/mutgKliYOvWrUpMTNT111+v3r1764YbblBFRUXd+erqat13331nvE5BQYEiIyO92ufVW8z3HgAAnDNTxcCECRPUu3dvVVVVacuWLYqIiFB6errKy8tNhebn56u6utqr9YnsYeoaAAAEjMfjv9YKmFozUFJSovfff19RUVGKiorSkiVLNGbMGGVkZGjFihUKDw9v0nWcTqecTqfXsSBHkJmuAAAQOK3kS9xfTBUD3333ndq29f6V559/Xm3atFHfvn316quv+rVzAAAg8EwVAz179tTatWuVmJjodfy5556TYRj6+c9/7tfOAQBgCZvdWmhqzcAvfvEL/fWvf23w3MyZM3X33XfLaCUrJwEAOB3DY/ittQamioH8/HwtXbr0tOcLCwvlsdk8CwAArR2bDgEA4Mtmf9hSDAAA4Is1AwAAwE4YGQAAwFcrWfjnLxQDAAD4Ys0AAAA2Z7NigDUDAADYXIsZGTjocVmSm9amgyW5kpScdI8luaVfvGJJriSlJN1rSa6zTbAluZL02aGvLMntHhFnSa4kHTdOWpLba9Y2S3Il6eiJ45bk7hp/jSW5klS9dI9l2QFnsw30WkwxAABAi8E0AQAAsBNGBgAA8MWthQAA2Bw7EAIAADthZAAAAF9MEwAAYG8GdxMAAAA7oRgAAMCXx/BfM6mwsFAJCQkKDQ1VcnKyVq1a1ejrX3nlFV1++eU677zzFBsbq/vuu0/79+83lUkxAACAL8Pjv2bCokWLlJubq0mTJqmsrEwZGRnKyspSeXl5g69fvXq1hgwZohEjRmjjxo36+9//rjVr1mjkyJGmcikGAADwZdHIwPTp0zVixAiNHDlSiYmJmjFjhjp37qyioqIGX//xxx+ra9eueuihh5SQkKDrrrtOo0aN0tq1a03lUgwAABBALpdLNTU1Xs3lqv88ntraWpWWliozM9PreGZmpkpKShq8dlpamr7++mstXbpUhmFo7969ev3113XHHXeY6qPpYmDz5s2aO3euvvzyS0nSl19+qd/+9rcaPny4/vWvfzXpGg39w7gNt9muAAAQGB6P31pBQYEiIyO9WkFBQb3Iffv2ye12Kzo62ut4dHS0KisrG+xmWlqaXnnlFWVnZyskJEQxMTFq3769nnvuOVNv11QxsGzZMl1xxRUaO3asrrzySi1btkzXX3+9tm/frvLyct12221NKgga+ofZWrPdVMcBAAgYP04T5Ofnq7q62qvl5+efNtrhcHj9bBhGvWOnbNq0SQ899JD+53/+R6WlpVq2bJl27typnJwcU2/XVDEwZcoUjRs3Tvv379fcuXM1aNAg3X///SouLtb777+v8ePHa+rUqWe8TkP/MJdGdDfVcQAAWgOn06mIiAiv5nQ6670uKipKQUFB9UYBqqqq6o0WnFJQUKD09HSNGzdOffr00W233abCwkLNmTNHFRUVTe6jqWJg48aNGjZsmCRpwIABOnz4sH71q1/Vnb/77rv1+eefn/E6Df3DBDmCzHQFAIDAseBugpCQECUnJ6u4uNjreHFxsdLS0hr8nWPHjqlNG++v8qCg779PDaPpixfPegfCNm3aKDQ0VO3bt687dv7556u6uvpsLwkAQMtg0XbEeXl5Gjx4sFJSUpSamqpZs2apvLy8btg/Pz9fe/bs0YIFCyRJ/fr10/3336+ioiLddtttqqioUG5urq655hrFxcU1OddUMdC1a1dt375d3bt/P6T/0UcfqUuXLnXnd+/erdjYWDOXBAAA/7/s7Gzt379fU6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ZknuhcHtLMm1UrDDuue6VJ2osSwb/sWaAQAAfBge/zWzCgsLlZCQoNDQUCUnJ2vVqlWnfe2wYcPkcDjqtV69epnKpBgAAMCHVcXAokWLlJubq0mTJqmsrEwZGRnKyspSeXl5g6//85//rIqKirq2e/duXXjhhfr1r39tKpdiAAAAH1YVA9OnT9eIESM0cuRIJSYmasaMGercubOKiooafH1kZKRiYmLq2tq1a3Xw4EHdd5+5KVmKAQAAAsjlcqmmpsaruVyueq+rra1VaWmpMjMzvY5nZmaqpKSkSVkvvfSSbrnlFtMPD6QYAADAl+HwWysoKFBkZKRXKygoqBe5b98+ud1uRUdHex2Pjo5WZWXlGbtcUVGhd999VyNHjjT9dlvM3QQAALQU/txnID8/X3l5eV7HnM7T38nmcDi8+2IY9Y41ZN68eWrfvr369+9vuo8UAwAABJDT6Wz0y/+UqKgoBQUF1RsFqKqqqjda4MswDM2ZM0eDBw9WSEiI6T4yTQAAgA/D4/Bba6qQkBAlJyeruLjY63hxcbHS0tIa/d2VK1dq+/btGjFixFm9X0YGAADwYdV2xHl5eRo8eLBSUlKUmpqqWbNmqby8XDk5OZK+n3LYs2ePFixY4PV7L730kq699lolJSWdVS7FAAAALUR2drb279+vKVOmqKKiQklJSVq6dGnd3QEVFRX19hyorq7W4sWL9ec///mscykGAADwYRhNH973t9GjR2v06NENnps3b169Y5GRkTp27Ny2AKcYAADAB08tNOHgwYOaP3++tm3bptjYWA0dOlSdO3c+4++5XK56Gy64PB4527CeEQCA5mbq2zcuLk7793//dMGdO3fqsssu07Rp07Rt2za9+OKL6t27t7788sszXqehDRiKqnae3TsAAMDPrLibwEqmioHKykq53W5J0qOPPqqePXvqP//5j5YvX67t27crIyNDv/vd7854nfz8fFVXV3u133ZMOLt3AACAnxmG/1prcNbTBJ988olmz56t8847T9L3myo89thjuuuuu874uw1twHCAKQIAQAvRWv6i9xfT38CntkR0uVwN7p/87bff+qdnAACgWZgeGbj55pvVtm1b1dTUaOvWrerVq1fdufLyckVFRfm1g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oD/lSpJjzzyiNLS0vT0009rwIAB+vTTTzVr1izNmjUr4Nkej0dz587V0KFD1bZt83089OvXT0899ZS6dOmiXr16qaysTNOnT9fw4cMDnv3ee+/JMAz16NFD27dv17hx49SjRw/dd999fs050+dGbm6unn76aV1yySW65JJL9PTTT+u8887ToEGDApp74MABlZeX193ff6oQjYmJOee9NRrLjouL01133aV169bpnXfekdvtrvtMu/DCCxUSEnJO2TDJylsZztXzzz9vxMfHGyEhIcZVV13VbLfYrVixwpBUrw0dOjSguQ1lSjLmzp0b0Nzhw4fX/Tv/5Cc/MW6++WZj+fLlAc08nea6tTA7O9uIjY01goODjbi4OOOXv/ylsXHjxoDnnvL2228bSUlJhtPpNHr27GnMmjWrWXLfe+89Q5KxZcuWZsk7paamxnj44YeNLl26GKGhoUa3bt2MSZMmGS6XK+DZixYtMrp162aEhIQYMTExxpgxY4xDhw75PedMnxsej8d4/PHHjZiYGMPpdBrXX3+9sWHDhoDnzp07t8Hzjz/+eECzT93K2FBbsWLFOWfDHIdhGEYgiw0AANCytco1AwAAwH8oBgAAsDmKAQAAbI5iAAAAm6MYAADA5igGAACwOYoBAABsjmIAAACboxgAAMDmKAYAALA5igEAAGzu/wMO3b23fsfDYgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 640x480 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_similarities(qa_df_confusing, qa_confusing)"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "provenance": []
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
